import request from '@/utils/request';

export function getTables(params) {
  return request({
    url: 'http://192.168.32.50:3050/auditdata',
    method: 'GET',
    params: {
      _page: params.page,
      _limit: params.size,
    },
  });
}

export function queryShop(params) {
  return request({
    url: 'http://192.168.32.50:3050/auditdata',
    method: 'GET',
    params,
  });
}

export function getTotal() {
  return request({
    url: 'http://192.168.32.50:3050/auditdata',
    method: 'GET',
  });
}

export function getMaterial(params) {
  return request({
    url: 'http://192.168.32.50:3050/Materiallist',
    method: 'GET',
    params: {
      _page: params.page,
      _limit: params.size,
    },
  });
}

export function getMaterialTotal() {
  return request({
    url: 'http://192.168.32.50:3050/Materiallist',
    method: 'GET',
  });
}

export function queryMaterial(params) {
  return request({
    url: 'http://192.168.32.50:3050/Materiallist',
    method: 'GET',
    params,
  });
}

export function addData(data) {
  return request({
    url: 'http://192.168.32.50:3050/Materiallist',
    method: 'POST',
    data,
  });
}

export function delData(id) {
  return request({
    url: 'http://192.168.32.50:3050/Materiallist/' + id,
    method: 'delete',
  });
}

export function editMaterial(data, id) {
  return request({
    url: `http://192.168.32.50:3050/Materiallist/${id}`,
    method: 'PATCH',
    data,
  });
}
